Real-Time Swimming Monitor

ABSTRACT

A wearable device for monitoring and providing real-time feedback about a swimmer&#39;s body motion and performance, in particular, body orientation and forward speed, is provided. The device comprises a three-axis accelerometer, optionally a three-axis gyroscope, a memory, and a microcontroller configured to process the sensor input, calculate a swimmer&#39;s performance and provide feedback to the swimmer through an output. The output can be an earpiece or a swimming goggle with a digital display.

CROSS-REFERENCE TO RELATED APPLICATIONS

This Application claims the benefit of PPA Ser. Nr. 61/137,841, filedAug. 4, 2008 by the present inventor.

FEDERALLY SPONSORED RESEARCH

Not Applicable

SEQUENCE LISTING OR PROGRAM

Not Applicable

FIELD OF THE INVENTION

The present invention relates to a method and system for monitoring aswimmer's performance and providing real-time feedback, particularly toa method and system for real-time measurement of a swimmer's bodyorientation and speed.

BACKGROUND OF THE INVENTION

In today's high tech era, it is becoming more and more common forrecreational as well as competitive athletes to resort to technology forimproving their performances. Swimming, in particular, is a sport wheretechnique is intricate and strongly correlated to performance level. Asmany swimming experts have pointed out, a swimmer's body orientation andcoordination is the most important factor in achieving optimalperformance. Without a streamlined body formation, the forces exerted bya swimmer's strokes and kicks do not efficiently translate to speed, andmay even hinder the swimmer's performance. Currently, swimmers relyheavily on observations from a coach or video footage to identify flawsin and possible improvements to their technique. However, such methodsnecessarily occur in a non real-time fashion, and thus prevent theswimmer from instantaneously and clearly recognizing body motion thatcontributes to enhanced performance. Real-time feedback is particularlyimportant in swimming because many aspects of the sport are opposite tohuman intuition; a swimmer's “feel” about his performance is usuallyinaccurate. For example, a swimmer may put in extra effort during aparticular lap but end up with an unexpected slower split time due topoor technique. Conversely, it is also common for a swimmer tounexpectedly achieve a better split time during a relaxed set. It wouldtherefore be advantageous to have systems and methods that providetechnique and performance feedback to swimmers in real-time. Suchsystems and methods would allow a swimmer to adjust his technique in themiddle of a set in response to such feedback, and observe theperformance consequences. Swimmers may use these systems and methodsduring training to identify techniques that most effectively translateto improved performance.

SUMMARY OF THE INVENTION

The present invention provides simple, practical, and accurate means formonitoring a swimmer's performance and providing real-time feedback. Inparticular, in one embodiment, the invention discloses a wearablemonitoring system that provides real-time monitoring of a swimmer's bodyorientation, speed, and other performance information so that theswimmer can instantly correlate his body motion with performance andconstantly adjust his technique and effort level to meet training goals.

The disclosed system comprises an electronic device and an output unit.The electronic device may be a device encased in a waterproof case andworn by a swimmer at the small of the back, on the abdomen, or on theback of the head. The output unit may be an earpiece or a pair ofswimming goggles with an integrated digital display. The electronicdevice may communicate with the output unit through a wire or wirelesscommunication technology.

The electronic device primarily comprises a 3-axis accelerometer, amicrocontroller and a memory unit. The accelerometer providesmeasurements of the acceleration produced by the swimmer's strokes andthe gravitational force. The microcontroller is configured with embeddedprograms to receive accelerometer measurements and calculate theswimmer's body orientation and forward speed.

Optionally, a 3-axis gyroscope may be included in the electronic deviceto improve a swimmer's body orientation calculation using body angularrate provided by the gyroscope. The rotational rate measurements fromthe gyroscope combined with the measurements made from the accelerometerprovide a six degree-of-freedom description of the swimmer's bodymotion, which is a comprehensive description of the swimmer's bodymotion. The six degree-of-freedom body motion kinematics equations canthen be solved to obtain accurate body orientation and forward speed.

The body orientation and speed calculations can be further improved byincluding one or more position sensors. These sensors are used tocompensate for drift errors introduced by integrating acceleration orbody rate due to the accelerometer/gyroscope output noises. The KalmanFilter algorithm may be employed to process the position sensor data andprovide an optimal compensation. For pool swimming, the position sensormay be a photoelectric sensor detecting pool markings such as black lanemarkings commonly found on swimming pool floors. For open waterswimming, where the drift error can be more significant, a GPS receivermay be used as the position sensor.

The memory unit in the electronic device can be a flash memory or amemory circuitry internal to the microcontroller. The memory unit isused for storing performance data that can be displayed after a workoutor downloaded to a personal computer for further analysis.

The data output for real-time feedback to a swimmer, via an earpiece ora swimming goggle with a digital display, may be speed, body rotationangles, swimming time, split time, lap counts, and stroke counts, amongother things.

DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a perspective view of one embodiment of the invention,comprising an electronic device and an output unit.

FIGS. 2A and 2B show the definitions of a swimmer's body orientationwith respect to a reference coordinate system.

FIGS. 3A, 3B, and 3C show a swimmer's body orientation in terms of Eulerangles.

FIG. 4 is a block diagram of one implementation of the electronic deviceof FIG. 1.

FIG. 5 shows a perspective view of an exemplary output unit of FIG. 1.

FIG. 6 is a schematic drawing of one embodiment of the electronic deviceof FIG. 4.

FIG. 7 shows a perspective view of one possible exterior appearance ofthe electronic device of FIG. 1.

FIGS. 8A and 8B show a perspective view of how one embodiment of thepresent invention may be used by a swimmer in a swimming pool.

FIG. 9 shows a flowchart generally describing a method of measuring andproviding feedback about a swimmer's body motion and performance.

FIGS. 10-14 further describe the details of each step in FIG. 9.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides a wearable data acquisition andprocessing system configured to measure a swimmer's body motion andperformance. As shown in FIG. 1, the disclosed system 100 comprises anelectronic device with an output unit. The electronic device may be adevice worn at the small of the back 101, on the abdomen 104, or on theback of the head 102. The output may be an earpiece 103 or a pair ofswimming goggles with an integrated digital display 105. The system 100is encased in a waterproof case. The electronic device (101, 102, or104) provides real-time motion measurements and feedback of theswimmer's performance through the output unit (103, 105) to the swimmer.The electronic device (101, 102, or 104) may communicate with the outputunit (103, 105) through a wire (107) or wireless communicationtechnology.

A swimmer's motion includes a swimmer's forward speed and bodyorientation with respect to the swimmer's surroundings. FIGS. 2A and 2Bprovide an exemplary description of a swimmer's body orientation interms of two coordinate systems: a body frame x-y-z 201 and a referenceframe X-Y-Z 203. The body frame 201 is fixed to the body of a swimmer(207 or 209): x-axis, designated as roll axis, is parallel to theswimmer's longitudinal axis; y-axis, designated as pitch axis, isparallel to the swimmer's lateral axis (from left to right); and z-axis,designated as yaw axis, is orthogonal to both x and y axes, running fromthe swimmer's back to the front. The electronic device would beconveniently worn on the swimmer's body such that the 3 axes of theaccelerometer are essentially aligned with the body frame x-y-z. Thereference frame 203 is fixed to the swimming pool structure 205. Thereference frame 203 can also be fixed with respect other landmarks, suchas buoys, the shoreline, or other landmarks for open water swimmers. InFIG. 2A, the body frame 201 for swimmer 207 is aligned with thereference frame 203. In contrast, the body frame 201 for swimmer 209 inFIG. 2B is not aligned with the reference frame 203, since he is in astanding (vertical) orientation. Note that a convenient definition ofthe reference frame 203 is such that the Z axis is parallel to thedirection of gravity.

With the above definitions of the coordinate systems, a swimmer's bodyorientation may be described quantitatively by the angular deviation ofthe body frame 201 from the reference frame 203 in terms of Eulerangles, namely, roll, pitch, and yaw angles. The Euler angles φ (roll)301, θ (pitch) 303, and ψ (yaw) 305 are described in FIGS. 3A, 3B, and3C, respectively. It is well-known that a freestyle swimmer shouldmaintain large roll angles 301 (hip rotations) and small pitch 303 andyaw 305 angles for optimal performance. Roughly speaking, a large rollangle 301 increases the effectiveness of the strokes, whereas smallpitch 303 and yaw 305 angles keep the swimmer's body in streamline. Asdescribed in the following paragraphs, the disclosed system measuresthese angles and the swimmer's speed in forward direction (X-axis), andprovides the swimmer feedback about his body form in real-time.

With reference now to FIG. 4, there is shown an exemplary electronicdevice 400 that can be used to implement electronic device (101, 102,104) of FIG. 1. Device 400 may comprise a 3-axis accelerometer unit 401,a microcontroller unit 407, a memory unit 411, a battery unit 413, and atimer 409 for the device. The accelerometer 401 provides measurements ofthe acceleration produced by the swimmer's strokes and the gravitationalforce. The accelerometer 401 may be conveniently worn on the swimmersuch that its three axes are each parallel to the x, y, and z axes ofbody frame 201 defined in FIG. 2, respectively.

The microcontroller 407 is configured with embedded computer programs toperiodically receive, at a selected sampling rate, measurements made byaccelerometer 401. The microcontroller 407 uses the receivedmeasurements to calculate in real-time the swimmer's instant bodyorientation by determining the amplitude of the gravitational componentalong each axis of the accelerometer 401. In other words, themicrocontroller 407 determines the angular differences in two dimensionsbetween the reference frame 203 and the body frame 201 as defined inFIG. 2.

The microcontroller 407 also calculates the speed of the swimmer byintegrating acceleration in the forward direction. The forward directioncan be defined to be in the direction of the X-axis in reference frame203 of FIG. 2. The forward speed may be calculated by mapping theaccelerometer measurements, which are made with respect to body frame201, to the reference frame 203, and integrating the component along theX-axis of reference frame 203. Thus, the orientation of body frame 201with respect to reference frame 203 is necessary for the speedcalculation. Note that since a three-axis accelerometer cannot providecomplete rotational information, the swimmer's translational androtational motion cannot be completely decoupled. This may lead toimperfect body orientation and speed calculations.

However, this shortfall can be overcome by also including in electronicdevice 400 a three-axis gyroscope 405. The output of gyroscope 405 isthe rate of change of roll angle (φ) 301, pitch angle (θ) 303, and yawangle (ψ) 305, as previously defined in FIG. 3. The rotational ratemeasurements provided by gyroscope 405 combined with the measurementsmade by accelerometer 401 provide a six degree-of-freedom description ofthe swimmer's body motion, which is a comprehensive description of theswimmer's body motion. The six degree-of-freedom body motion kinematicsequations can then be solved to obtain accurate body orientation and theforward speed.

The body orientation and speed calculations can be further improved byincluding calibration means. In general, integration of sensor outputcan introduce drift error over time due to the accumulation of sensornoise and/or bias. Calibration can serve to compensate for the drifterror. Accordingly, electronic device 400 may optionally include one ormore photoelectric sensors 425 to provide swimmer position informationthat can be used to estimate and cancel the drift error. In oneembodiment, photoelectric sensors 425 may be configured to detectmarkings in the swimmer's surroundings. These markings can be, forexample, black lane markings commonly found on swimming pool floors andwalls, or colored lane lines. These markings are particularly usefulbecause they generally are located at standardized locations alongcompetition-sized pools.

Another way to provide calibration means is to include a GPS receiver427 in device 400 that can provide location measurements tomicrocontroller 407. GPS receiver 427 may be particularly useful foropen water swimming, where accelerometer and/or gyroscope drifts can bemore significant.

The calibration scheme employed by microcontroller 407 can be based on aKalman Filter optimal estimation algorithm. A Kalman Filter algorithmoptimally weighs the position measurements obtained from the calibrationmeans, such as photoelectric sensors 425 or GPS receiver 427, to correctfor drift errors in the speed and body orientation values computed byintegration.

With continued reference to FIG. 4, device 400 may also include memoryunit 411. Memory 411 can be a flash memory or a memory circuitryinternal to microcontroller 407. Microcontroller 407 may periodically orcontinuously store sensor data and calculated information into thememory, thereby creating a history of the swimmer's body motion andperformance. The length of time between consecutive storages (samplingrate) can be programmed into microcontroller 407 as a design parameter.

The body orientation calculations and the sensor measurements describedabove can be further processed to determine a swimmer's mode ofactivity. A swimmer's mode of activity can be, for example, diving intothe pool, taking a stroke, gliding, doing a turn, pushing off a wall,standing vertically, and stopping at the end of a lap. In an exemplaryembodiment, microcontroller 407 determines the swimmer's current mode ofactivity by looking at a combination of both the current sensor inputsand body orientation calculations and also the history data stored inmemory 411, as described in the previous paragraph. Specifically,microcontroller 407 may look at the swimmer's mode of activity at thelast time step to determine the mode of activity at the current timestep.

Referring back to FIG. 4, device 400 may also include a timer unit 409.Timer 409 can be internal or external to microcontroller 407. In someembodiments, timer 409 can be driven by a crystal oscillator. Timer 409can include a master timer that is incremented by microcontroller 407.Device 400 may use the master timer for synchronization of internalactivities; however, the master timer value can also be outputted to theuser. In addition to a master timer, Timer 409 can also include one ormore split timers. The split timer can be used by the swimmer to recordsplit times of each lap. Advantageously, the split timer can beautomatically reset based on changes in the swimmer's mode of activity.Specifically, microcontroller 407 may reset the split timer each timethe mode of activity is “pushing off the wall”, as described above. Thesplit timer values can also be stored periodically in memory 411.

In addition to automatically resetting the split timer, the mode ofactivity information can also be used to automatically record theswimmer's stroke count per lap or total stroke count. Themicrocontroller 407 may determine the stroke count by tracking thenumber of times the swimmer's mode of activity is “taking a stroke”between consecutive split timer resets or as a running total. The strokecount can also be periodically stored in memory 411.

When the swimmer's mode of activity is gliding or stroking,microcontroller 407 may use the calculated body orientation to determinethe amplitude of the swimmer's hip rotation (along the roll axis 301,FIG. 3, for example). The microcontroller 407 may be programmed with apredetermined range of acceptable hip rotation amplitude values,preferably determined by a swimming expert. When the swimmer's hiprotation falls outside of the acceptable range, microcontroller 407 mayoutput a warning to the swimmer informing him of the deviation from goodswimming form.

Referring now to FIG. 5, there are shown two exemplary output devicesthat can be used to implement output device 103 and 105 in FIG. 1.Exemplary output device 501 is an earpiece that the swimmer can wearwhile swimming. Output device 501 may be connected to device 400 via awire or wireless technology. Output device 501 may provide the swimmerwith feedback about his performance. This may include hip rotationwarnings, as described above, instantaneous speed, and the master timeror split timer values, for example. Alternatively, the same performancefeedback can also be provided visually to the swimmer via output device503, which is a display mounted onto a goggle. In this manner, theswimmer's performance is provided to the swimmer in real-time while heis swimming.

In addition to the information provided to the swimmer in real-time,device 400 of FIG. 4 can also provide a summary of the workout to theswimmer in response to a request by the swimmer. The workout summery mayinclude, for example, the average stroke court per lap, average splittime, average speed, and the total workout time and distance. Theworkout summary may be provided through output devices 501 or 503, oranother type of output device such as a wristwatch or a displayintegrated into device 400.

Referring back to FIG. 4, device 400 may optionally include an inputunit 421. Input unit 421 can be used by the swimmer to provide device400 with additional information. Such additional information mayinclude, for example, the type of stroke the swimmer is planning onswimming, whether he is in a pool or in open water, and what kind offeedback the swimmer desires to receive through the output device 501 or503. Such additional information may be used in the calculation of bodyorientation and speed. Input unit 421 may include push buttons that maybe used to navigate a control menu that is provided to the swimmer via adisplay 419. Display 419 may be a display integrated into device 400, ormay be the same display as in output device 503. The control menu mayalso be an audio control menu that may be navigated using input 421 viaoutput 501.

In addition to providing real-time feedback and workout summariesthrough the various output devices, the sensor raw data and calculatedperformance data stored in memory 411 may also be downloaded to apersonal computer for further analysis through communication interface415. Interface 415 may be, for example, a USB port. The downloaded rawdata and processed data (e.g., the time histories of body orientationand speed) may be used to reconstruct the swimmer's performance anddetailed body motions for ex post analysis, perhaps by a coach orswimming expert.

Now with reference to FIG. 6, there is shown schematic diagram of oneimplementation 600 of device 400. Implementation 600 usesmicrocontroller 601, which can be, for example, PIC18F4550 fromMicrochip Technology and accelerometer 603 ADXL 330 from Analog Devices.The memory unit 611 can be a non-volatile Electrically ErasableProgrammable Read-Only Memory (EEPROM) integrated circuit chip.

FIG. 7 shows the exterior appearance of one embodiment of the invention.The electronic device is encased in a water-proof case that is wearableon a swimmer's body near his center of gravity (CG) such as the small ofthe back or abdomen, or on the back of the head. The device is worn by aswimmer such that the x-y-z axes of the accelerometer are parallel tothe body x-y-z axes (FIG. 2). That is, the x-axis of the accelerometeris along the swimmer's longitudinal axis (body x-axis) and z-axis of theaccelerometer is aligned with the gravity direction when the swimmer isfloating horizontally. The device 700 connects to the output unit 501 or503 (FIG. 5) by wire 709. A wireless technology can alternatively beused. A prospective user may use push buttons 701 and a liquid crystaldisplay 703 to turn on/off the device and navigate the operation menu.Instead of display 703, the menu can also be provided audibly throughearpiece 501, for example. The USB port 705 may be used to download thestored data to a personal computer for further analysis.

FIGS. 8A and 8B demonstrate one particularly simple but stilladvantageous use of the present invention for providing a swimmer withreal-time performance feedback. As previously described, device 400 ofFIG. 4 can periodically provide swimmer 809 with the value of the timer409. The value of the timer can be the total elapsed time from the startof the workout or the elapsed time from the beginning of a lap, asmaintained by the split timer. The value of the timer may be the actualtime value in minutes or seconds, or it may be a “count” value that isproportional to the actual elapsed time. The value of the timer can beprovided to swimmer 809 audibly via earpiece 801 or visually via display803. In FIG. 8A, swimmer 809 is shown to receive a count value of“seven” when she is at one location in the pool; the count hasincremented to “fourteen” by the time she reaches the end of the pool.By periodically receiving the elapsed time value, the swimmer canmonitor the timing of the passages of certain landmarks in the swimmingpool (e.g., markers 811 and 815) during the course of swimming. Theswimmer may use this information to compare with her previousperformance (e.g., an earlier lap in the same set), and adjust hertechnique and effort level accordingly. The advantage of using the timerfunction to evaluate the speed, instead of directly using the calculatedspeed, is its simplicity and accuracy in operation, requiring lessconcentration on the fluctuating instant speed. Swimmers have their ownbenchmark performance to compare with in a relative manner, which doesnot need an accurate absolute speed at all times.

In the exemplary scenario shown in FIG. 8A, the timer starts whenswimmer 809 initiates a new lap. The signal sent to the earpiece is theelapsed time counts. It may be announced in English, or another selectedlanguage, or certain audio tunes. For example, the elapsed time count801 is announced as “one, two, three, . . . ” in every 2 seconds. Asillustrated, the earpiece says “seven” when swimmer 809 passes themiddle line mark 811. That is, it takes swimmer 809 fourteen seconds toreach the middle line mark 811. When the swimmer reaches the end line815, the earpiece 805 announces “fourteen.” With an adjustment of hertechnique, the swimmer 809 in FIG. 8B realizes that this adjustment iseffective when she passes the middle line mark 811 before “seven” isannounced in the earpiece 801. As the result, the swimmer reaches theend line 815 when “thirteen” is announced.

In FIG. 9, there is shown a flowchart generally describing a method ofmeasuring and providing feedback about a swimmer's body motion andperformance. At step 901, measurements are received from a sensor wornby the swimmer. The sensor may be an accelerometer or a gyroscope orboth. The sensor data may be processed by a microcontroller withembedded programs. At step 903, a timer value is maintained. At step905, a swimmer's body orientation is calculated. At step 907, based onthe body orientation and acceleration, a swimmer's mode of activity isidentified. At step 909, a swimmer's forward swimming speed iscalculated. At step 911, additional position sensor data may optionallyused to calibrate the calculated body orientation and forward speed. Theposition sensor may be a photoelectric sensor or a GPS receiver. At step913, a swimmer's performance data is extracted from the body motioninformation and formatted for storage and output. At step 915, aswimmer's body motion and performance data is stored in a memory. Atstep 917, a swimmer's performance is outputted to the swimmer for realtime feedback. In the following paragraphs, more detailed disclosuresare given for each of these steps.

With reference to step 901 in FIG. 9, there is shown a flow chart FIG.10 further describing the sensor data receiving and processing function.At step 1001, raw sensor data is received from an accelerometer or agyroscope. At step 1003, a low-pass filter may be applied to the rawsensor data to eliminate high frequency sensor noises, where a (1009)and w (1007) are the filtered, three dimensional acceleration andangular rate vectors, respectively. At step 1005, another low-passfilter may be applied to acceleration a to extract gravity vector a_(g)(1011) from a (1009). This method is effective because that the gravityis constant in amplitude and of low frequency in directional variationin swimmer's body frame compared to the acceleration from swimmer'sstrokes.

With reference to step 903 in FIG. 9, there is shown a flow chart FIG.11 further describing the timer function. The timer can be a mastertimer that is continuously incremented as shown at step 1101. At step1103, the master timer may serve as a timing reference forsynchronization of system operations such as input/output, computations,storing data, and other activities. At step 1105, the master timer mayalso drive one or more split timers for various functions. A split timermay be synchronized with the local time and may be reset manually by auser or autonomously by the embedded program in the microcontroller whencertain motion conditions are met.

With continued reference to FIG. 9, at step 905, there is shown aflowchart in FIG. 12A further describing the method of calculating aswimmer's body orientation using the accelerometer input only. The bodyorientation calculation using both accelerometer and gyroscope data isdescribed later in FIG. 12B. At step 1201, a three dimensional vector ofgravity in the body frame 201 (FIG. 2) is calculated by Eq. 1.

$\begin{matrix}{a_{g} = \begin{bmatrix}{Accel}_{x} \\{Accel}_{y} \\{Accel}_{z}\end{bmatrix}} & (1)\end{matrix}$

where Accel_(x), Accel_(y), and Accel_(z) are input from the 3-axisaccelerometer after passing low-pass filter 1005 (FIG. 10). Note thatalthough most high-frequency acceleration components may have beenfiltered out by filter 1005, the body frame gravity vector a_(g) (1011)may still include residual accelerations due to swimmer's strokes orother motions, therefore, the calculation of the gravity in body framemay not be very accurate. Essentially, this is an estimation method thatmay result in imperfect body orientation calculations. This shortfall,however, can be overcome by using a gyroscope; the method of which willbe disclosed next. At step 1203, the body roll angle φ (301) and pitchangle θ (303), which are defined in FIG. 3, are calculated by Eqs. 2 and3 with respect to the reference frame that is defined in FIG. 2

$\begin{matrix}{\phi = {{arc}\; \tan \frac{{Accel}_{y}}{{Accel}_{z}}}} & (2) \\{\theta = {{arc}\; \tan \frac{- {Accel}_{x}}{{Accel}_{z}}}} & (3)\end{matrix}$

In FIG. 12B, there is shown a flowchart further describing the bodyorientation calculation using gyroscope data. With a 3-axis gyroscope,complete body rotational information of a swimmer can be obtained. Thecomplete description of a body orientation with respect to a referenceframe may be expressed by a quaternion. A quaternion is a 4-dimensionalvector that is used to represent an arbitrary body orientation withrespect to a reference frame. A quaternion q is defined by the followingequation.

$\begin{matrix}{q = {\begin{bmatrix}q_{1} \\q_{2} \\q_{3} \\q_{4}\end{bmatrix} = \begin{bmatrix}{e\; {\sin \left( \frac{\alpha}{2} \right)}} \\{\cos \left( \frac{\alpha}{2} \right)}\end{bmatrix}}} & (4)\end{matrix}$

where

$e = \begin{bmatrix}e_{1} \\e_{2} \\e_{3}\end{bmatrix}$

is the unit rotation vector from the reference frame to the body frameand a is the rotation angle. For example, refer to FIG. 2B, thequaternion representing the body orientation of swimmer 209 is

$\begin{matrix}{q = \begin{bmatrix}0 \\0.707 \\0 \\0.707\end{bmatrix}} & (5)\end{matrix}$

This is because that the swimmer's body orientation is obtained byrotating 90 degrees about y-axis from the swimmer's initial orientationthat is aligned with the reference frame like swimmer 207 in FIG. 2A.Therefore,

$\begin{matrix}{{e = {{y\text{-}{axis}} = \begin{bmatrix}0 \\1 \\0\end{bmatrix}}}{and}} & (6) \\{\alpha = {90\mspace{14mu} {degrees}}} & (7)\end{matrix}$

A unit quaternion is

$\begin{matrix}{q = \begin{bmatrix}0 \\0 \\0 \\1\end{bmatrix}} & (8)\end{matrix}$

which represents a body frame that is aligned with the reference frame(a=0).

At step 1251, a swimmer's body orientation (quaternion) may beinitialized to Eq. 5, if a swimmer is in standing position facing thefar end of the pool like swimmer 209 in FIG. 2B. The initialization maybe achieved by pushing a button on the device. This initialization maybe performed once at the beginning of a swimming session or at any timewhen a swimmer is in the standing and the far-end-facing position. Thequaternion may also be initialized autonomously, which may be triggeredby the acceleration impulse from pushing off the wall to start a newlap. In this case, the initial value can be calculated using Eq. 4,based on the direction of gravity in the body frame. For example, if theaccelerometer shows that the gravity is aligned with z-axis at thepush-off, then the quaternion can be initialized to Eq. 8. One advantageof the autonomous initialization is that the gyroscope drift can beeliminated from regularly resetting the orientation to a known state.

With an initial value q₀, the swimmer's body quaternion can bepropagated as a function of time t per step 1253 using the body angularrate sensed from the gyroscope.

$\begin{matrix}{{q(t)} = {{\exp \left( {\frac{1}{2}{\int_{0}^{t}{{\Omega (\tau)}\ {\tau}}}} \right)}q_{0}}} & (9)\end{matrix}$

where exp( ) is the matrix exponential function,

$\begin{matrix}{\Omega = \begin{bmatrix}0 & \omega_{z} & {- \omega_{y}} & \omega_{x} \\{- \omega_{z}} & 0 & \omega_{x} & \omega_{y} \\\omega_{y} & {- \omega_{x}} & 0 & \omega_{z} \\{- \omega_{x}} & {- \omega_{y}} & {- \omega_{z}} & 0\end{bmatrix}} & (10)\end{matrix}$

and

$w = \begin{bmatrix}\omega_{x} \\\omega_{y} \\\omega_{z}\end{bmatrix}$

is body angular rate vector from the gyroscope. To convert thequaternion to Euler angles, the following equation may be used.

$\begin{matrix}{\begin{bmatrix}\phi \\\theta \\\psi\end{bmatrix} = {\begin{bmatrix}q_{1} \\q_{2} \\q_{3}\end{bmatrix}\frac{360}{\pi}}} & (11)\end{matrix}$

where φ, θ, and ψ are roll, pitch and yaw angles in degrees,respectively.

With continued reference to FIG. 9, at step 907, there is shown aflowchart in FIG. 13 further describing the identification of mode ofactivity. At step 1301, based on the previously calculated bodyorientation, a swimmer's body orientation is identified, for example, tobe one of the four categories: horizontal facing up, horizontal facingdown, vertical up and vertical down. When a swimmer is standing, he isin vertical up position. When a swimmer is making a flip turn, hisposition will be vertical down and then transitioned to horizontal up.When a swimmer is gliding or stroking in freestyle, his position ishorizontal down. At step 1303, impulsive accelerations along the bodyx-axis is monitored to further distinguish a gliding mode from strokingmode and confirm a push-off start mode or a stop mode. Step 1305 furtherconfirms the current mode of activity using the previous modeinformation. For example, a flip turn mode is likely to be transitionedto from a gliding mode.

With continued reference to FIG. 9, at step 909, the forward speed of aswimmer is calculated by integrating acceleration in the forwarddirection. Note that the body x-axis of a swimmer may not be perfectlyaligned with the desired swimming direction (X-axis); therefore, thespeed from integrating the x-axis acceleration may not be accurate. Thisscenario can be seen in FIG. 3C, where the side-way speed componentwould be undesirably included in the forward speed calculation. Thereason for this error is that the yaw angle v is not observable to theaccelerometer. However, this shortfall can be overcome by using theswimmer's body quaternion derived from a gyroscope (Eq. 9). When thequaternion is used, the forward speed can be obtained by integrating theacceleration along X-axis, instead of x-axis. This method consists ofthe following two steps.

$\begin{matrix}{\overset{\_}{a} = {\begin{bmatrix}{q_{1}^{2} - q_{2}^{2} - q_{3}^{2} + q_{4}^{2}} & {2\left( {{q_{1}q_{2}} + {q_{3}q_{4}}} \right)} & {2\left( {{q_{1}q_{3}} - {q_{2}q_{4}}} \right)} \\{2\left( {{q_{1}q_{2}} - {q_{3}q_{4}}} \right)} & {{- q_{1}^{2}} + q_{2}^{2} - q_{3}^{2} + q_{4}^{2}} & {2\left( {{q_{2}q_{3}} + {q_{1}q_{4}}} \right)} \\{2\left( {{q_{1}q_{3}} + {q_{2}q_{4}}} \right)} & {2\left( {{q_{2}q_{3}} - {q_{1}q_{4}}} \right)} & {{- q_{1}^{2}} - q_{2}^{2} + q_{3}^{2} + q_{4}^{2}}\end{bmatrix}\; \times a}} & (12) \\{\mspace{79mu} {v_{cal} = {\int_{0}^{t}{\begin{bmatrix}1 & 0 & 0\end{bmatrix}\  \times \overset{\_}{a}{t}}}}} & (13)\end{matrix}$

where a (1009, FIG. 10) is a swimmer's acceleration in the body frameobtained from the accelerometer, ā is the swimmer's acceleration in thereference frame and v_(cal) is the swimmer's speed in the forwarddirection.

With continued reference to FIG. 9, at step 911, there is shown aflowchart in FIG. 14 further describing how the calculations of bodyorientation and forward speed can be further improved by includingcalibration means. In general, integration of sensor output canintroduce drift error over time due to the accumulation of sensor noiseand bias. Calibration can serve to compensate for the drift error usingadditional independent position data. The data may be produced by aphotoelectric sensor or a GPS receiver mounted on a swimmer's body. Forexample, a photoelectric sensor, which detects certain pool markingssuch as black lane markings commonly found on swimming pool floors, canbe used to calibrate the forward speed and accelerometer bias. Thecalibration method at step 911 comprises three major steps as shown inFIG. 14, which follows the optimal estimation theory, in particular,Kalman Filter algorithm. The following simple example is given so thatthe insight of the mathematics of Kalman Filter algorithm can beunderstood.

Referring back to FIG. 8A, if the location of the middle line mark 811is known, then the expected mark passing time is

$\begin{matrix}{t_{\exp} = \frac{d_{mark}}{v_{cal}}} & (14)\end{matrix}$

where v_(cal) is the calculated forward speed and d_(mark) is thedistance of mark 811 from the pool's starting wall. Using thephotoelectric sensor to take a snapshot at the split timer when thesensor detects its crossing mark 811, then the measured mark passingtime t_(mea) is obtained. At step 1401, the measurement residual iscalculated by

z=t _(mea) −t _(exp)   (15)

The residual z may be used to correct the calculated forward speedv_(cal) and compensate for the accelerometer bias by the followingequations.

v _(cal) =v _(cal) −K _(v) z   (16)

a=a−K _(a) z   (17)

where a (1009, FIG. 10) is a swimmer's acceleration in the body frameobtained from the accelerometer, K_(v) and K_(a) are “gains” for speedand acceleration compensations. The gains are used to weight how muchcompensation should be applied to the speed and acceleration using theresiduals. Since noise also exists in photoelectric sensor output, it isnot desirable to apply the compensation excessively. In fact, based onthe sensor noise characteristics, optimal gains can be calculated usingthe Kalman Filter algorithm (step 1403). Once the Kalman Filter gainsare calculated, at step 1405, the speed and acceleration are compensatedby Eqs. 16 and 17, respectively.

Although the above discussion is about speed and accelerometer biascalibrations, the same logic applies to the body orientation andgyroscope bias calibrations.

With continued reference to FIG. 9, at step 913, a swimmer's performancecan be extracted from his body motion data calculated above. Theperformance data, including a swimmer's instant speed, average speed,hip rotations, pitch and yaw angles, split time, stroke counts per lap,total laps, and other data, is formatted for storage at step 915 andoutput at step 917.

The foregoing description of the invention illustrates and describes thepresent invention. Additionally, the disclosure shows and describes onlythe preferred embodiments of the invention, but as aforementioned, it isto be understood that the invention is capable of use in various othercombinations, modifications, and environments and is capable of changesor modifications within the scope of the inventive concept as expressedherein, commensurate with the above teachings, and/or the skill orknowledge of the relevant art. The embodiments described hereinabove arefurther intended to explain best modes known of practicing the inventionand to enable others skilled in the art to utilize the invention insuch, or other, embodiments and with the various modifications requiredby the particular applications or uses of the invention. Accordingly,the description is not intended to limit the invention to the formdisclosed herein. Also, it is intended that the appended claims beconstrued to include alternative embodiments.

1. A wearable data acquisition and processing system configured tomeasure a swimmer's body motion and performance, the system comprising:a three-axis accelerometer; a memory; an output device; and amicrocontroller configured to: receive input from the accelerometer;calculate in real-time the swimmer's instant body orientation withrespect to the swimmer's surroundings; calculate in real-time theswimmer's instant speed in a forward direction; increment a timer;periodically store in the memory the received accelerometer input, theinstant body orientation, and the instant speed in the forwarddirection; and periodically output to the output device the timer valueand the instant speed in the forward direction.
 2. The wearable systemdefined in claim 1, wherein the microcontroller is further configured tocalculate the instant body orientation with respect to gravity.
 3. Thewearable system defined in claim 1, wherein the microcontroller isfurther configured to determine in real-time the swimmer's mode ofactivity, wherein the mode of activity is selected from a groupcomprising: diving; gliding; stroking; standing; turning; pushing off awall; and stopping; and wherein the mode of activity is determined fromat least one of the received accelerometer input, the instant bodyorientation, and the periodically stored body orientations from thememory.
 4. The wearable system defined in claim 3, wherein the timerfurther comprises a split timer that resets when the swimmer's mode ofactivity is pushing off the wall or diving, and wherein themicrocontroller is further configured to periodically store the splittimer values into the memory.
 5. The wearable system defined in claim 4,wherein the microcontroller is further configured to record in thememory the number of times the swimmer's mode of activity is strokingbetween a consecutive pair of split timer resets.
 6. The wearable systemdefined in claim 1, wherein the microcontroller is further configured tocalculate the instant speed in the forward direction by integrating thereceived accelerometer input and the periodically stored accelerometerinputs, wherein the forward direction is determined by the instant bodyorientation.
 7. The wearable system defined in claim 1, wherein themicrocontroller is further configured to: determine a rotation valuefrom the instant body orientation; and output a warning signal to theoutput device when the rotation value is outside a predetermined rangeof values.
 8. The wearable system defined in claim 1, wherein content inthe memory is downloadable to a personal computer for further analysis.9. The wearable system defined in claim 1, further comprising athree-axis gyroscope configured to provide rotational measurements tothe microcontroller, and wherein the microcontroller is furtherconfigured to calculate the instant body orientation and the instantspeed in the forward direction based on the provided rotationalgyroscope measurements and the received accelerometer inputs.
 10. Thewearable system defined in claim 1, further comprising at least onephotoelectric sensor configured to detect markings in the swimmer'ssurroundings, and wherein the microcontroller is further configured touse the at least one photoelectric sensor to calibrate the instant speedin the forward direction and the instant body orientation.
 11. Thewearable system defined in claim 1, further comprising a GPS receiverconfigured to provide location measurements to the microcontroller, andwherein the microcontroller is further configured to use the providedlocation measurements to calibrate the instant speed in the forwarddirection.
 12. The wearable system defined in claim 1, furthercomprising an input device that provides input to the microcontroller,and wherein the microcontroller is further configured to: calculate aworkout summary comprising at least one of an average instant speed inthe forward direct, average stroke count between split timer resets, andfinal timer value; and output the workout summary to the output devicebased on the provided input.
 13. The wearable system defined in claim 1,wherein the output device is an earpiece.
 14. The wearable systemdefined in claim 1, wherein the output device is a display attached to agoggle.
 15. A method of measuring and providing feedback about aswimmer's body motion and performance, the method comprising: receivinginput from a three-axis accelerometer; calculating in real-time theswimmer's instant body orientation with respect to the swimmer'ssurroundings; calculating in real-time the swimmer's instant speed in aforward direction; incrementing a timer; periodically storing thereceived accelerometer input, the instant body orientation, and theinstant speed in the forward direction; and periodically outputting thetimer value and the instant speed in the forward direction.
 16. Themethod defined in claim 15, wherein calculating the instant bodyorientation comprises calculating the instant body orientation withrespect to gravity.
 17. The method defined in claim 15, furthercomprising determining in real-time the swimmer's mode of activity fromat least one of the received accelerometer input, the instant bodyorientation, and the periodically stored body orientations, wherein themode of activity is selected from a group comprising: diving; gliding;stroking; standing; turning; pushing off a wall; and stopping.
 18. Themethod defined in claim 17, wherein incrementing the timer comprisesincrementing a split timer that resets when the swimmer's mode ofactivity is pushing off the wall or diving; and periodically storing thesplit timer values.
 19. The method defined in claim 18, furthercomprising counting the number of times the swimmer's mode of activityis stroking between a consecutive pair of split timer resets.
 20. Themethod defined in claim 15, wherein calculating the instant speed in theforward direction comprises integrating the received accelerometer inputand the periodically stored accelerometer inputs, wherein the forwarddirection is determined by the instant body orientation.
 21. The methoddefined in claim 15, further comprising: determining a rotation valuefrom the instant body orientation; and outputting a warning signal whenthe rotation value is outside a predetermined range of values.
 22. Themethod defined in claim 15, further comprising: receiving rotationalmeasurements from a three-axis gyroscope; and calculating the instantbody orientation and the instant speed in the forward direction based onthe received rotational gyroscope measurements and the receivedaccelerometer inputs.
 23. The method defined in claim 15, furthercomprising calibrating the instant speed in the forward direction andthe instant body orientation by detecting markings in the swimmer'ssurroundings using at least one photoelectric sensor.
 24. The methoddefined in claim 15, further comprising calibrating the instant speed inthe forward direction based on location measurements of the swimmer madeby a GPS receiver.
 25. The method defined in claim 15, furthercomprising: receiving at least one user input; calculating a workoutsummary comprising at least one of an average instant speed in theforward direct, average stroke count between split timer resets, andtotal workout duration; and outputting the workout summary based on theat least one user input.